<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name','50')->comment('真实姓名');
            $table->string('photo','512')->default("")->comment('照片');
            $table->string('phone','64')->unique()->comment('手机');
            $table->string('email','64')->nullable()->comment('邮箱');
            $table->string('password', 60);
            $table->string('sex','64')->default('F')->comment('性别,参照系统代码SEX');
            $table->string('wx_no','255')->default('')->comment('微信号');
            $table->string('work_no','255')->default('')->comment('工号');
            $table->bigInteger('major_department_id')->default('0')->comment('主要部门');
            $table->bigInteger('major_station_id')->default('0')->comment('主要岗位');
            $table->bigInteger('direct_leader_user_id')->default('0')->comment('直属领导ID');
            $table->integer('account_status')->default('1')->comment('账号状态 参照系统代码 ACCOUNT_STATUS');
            $table->string('account_type',64)->default('teacher')->comment('账号类型 参照系统代码 ACCOUNT_TYPE');
            $table->string('created_user',64)->default("")->comment('创建人');
            $table->string('updated_user',64)->default("")->comment('修改人');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
